﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="department.aspx.cs" Inherits="GDIT.page.manage.user.department" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>部门管理</title>
    <link href="../../../css/m_department.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div class="all">





<ul class="departmentList">
    <li class="title">部 门 列 表</li>
    <%--<li><input type="hidden" value='<%#Eval("部门id") %>' /><a class="department"><%#Eval("部门名称") %></a></li>--%>
    <%--<li><input type="hidden" value="" /><a class="department">宣传部</a></li>--%>
    <asp:Repeater ID="DepartmentRepeater" runat="server">
        <ItemTemplate>
            <li><input type="hidden" value='<%#DataBinder.Eval(Container.DataItem, "OID") %>' /><a class="department"><%#DataBinder.Eval(Container.DataItem, "DepartmentName")%></a></li>
        </ItemTemplate>
    </asp:Repeater>
</ul>

<!--弹出层开始-->
<div class="hyaline"></div>
<div class="popup">
    <asp:HiddenField ID="hdfHiddenId" runat="server" />
    <asp:TextBox ID="txtName" runat="server" CssClass="txtName"></asp:TextBox>

    <a title="关闭" href="javascript:void(0);" class="close" onclick="ClosePopup();"></a>
    <asp:LinkButton ID="btnSave" runat="server" NavigateUrl="javascript:void(0);" CssClass="save" Title="保存" OnClick="btnSave_Click"></asp:LinkButton>
    <asp:LinkButton ID="btnAdd" runat="server" NavigateUrl="javascript:void(0);" CssClass="add" Title="添加" OnClick="btnAdd_Click"></asp:LinkButton>
    <asp:LinkButton ID="btnDelete" runat="server" NavigateUrl="javascript:void(0);" CssClass="delete" Title="删除" OnClick="btnDelete_Click"></asp:LinkButton>
</div>
<!--弹出层结束-->

<script type="text/javascript">
    function Ready() {
        var departments = GetElementsByClass("department");
        for (var i = 0; i < departments.length; i++) {
            departments[i].href = "javascript:void(0);";
            departments[i].onclick = department_click;
        }


    }
    Ready();

    function department_click() {
        GetElementsByClass("hyaline")[0].style.display = "block";
        GetElementsByClass("popup")[0].style.display = "block";
        GetElementsByClass("txtName")[0].value = this.innerHTML;

    }

    function ClosePopup() {
        GetElementsByClass("hyaline")[0].style.display = "none";
        GetElementsByClass("popup")[0].style.display = "none";
    }

    function GetElementsByClass(className) {
        var events = new Array();
        var allEvents = document.getElementsByTagName("*");
        for (var i = 0; i < allEvents.length; i++) {
            var classNames = allEvents[i].className.split(" ");
            for (var j = 0; j < classNames.length; j++) {
                if (classNames[j] == className) {
                    events[events.length] = allEvents[i];
                }
            }
        }
        return events;
    }
</script>





</div>
</form>
</body>
</html>
